/**
* @file BigInteger.h in Leetcode
* @author rebeater
* @comment
* Create on 8/14/21 6:02 PM
* @version 1.0
**/

#ifndef LEETCODE__BIGINTEGER_H_
#define LEETCODE__BIGINTEGER_H_
#include <vector>
#include <iostream>
using namespace std;
class BigInteger {
 public:
  static const int numeration = 10;/*进制*/
  vector<int> data;
  bool positive;/*正的*/
 public:
  BigInteger();
  int Length() const;
  bool IsPositive()const;

  BigInteger(int d);
  BigInteger(long long d);

  operator int();

  friend BigInteger operator+(const BigInteger &a, int b);
  friend BigInteger operator+=(BigInteger &a, int b);

  friend BigInteger operator+(const BigInteger &a, const BigInteger &b);
  friend BigInteger operator+=(BigInteger &a, const BigInteger &b);
  friend BigInteger operator+=(BigInteger &a, int b);

  friend BigInteger operator-(const BigInteger &a);/*取反*/
  friend BigInteger operator-(const BigInteger &a,int b);
  friend BigInteger operator-(const BigInteger &a,const BigInteger &b);
  friend BigInteger operator-=( BigInteger &a,const BigInteger &b);
  friend BigInteger operator-=( BigInteger &a,const int b);

  friend BigInteger operator*(const BigInteger &a, int b);
  friend BigInteger operator*=(BigInteger &a, int b);

  friend BigInteger operator*(const BigInteger &a, const BigInteger &b);
  friend BigInteger operator*=(BigInteger &a, const BigInteger &b);

  friend ostream &operator<<(ostream &os, BigInteger &bi);
  friend istream &operator>>(istream &os, BigInteger &bi);

// private:
  void arrange();
//  BigInteger(int d);
};

#endif //LEETCODE__BIGINTEGER_H_
